var e,
  t =
    (e = require("../../@babel/runtime/regenerator")) && e.__esModule
      ? e
      : { default: e },
  r = require("../../@babel/runtime/helpers/asyncToGenerator");
Component({
  properties: {
    videoSrc: { type: String, value: "" },
    tap: { type: Boolean, value: !1, observer: "upDate" },
  },
  data: { isShowVideoBtn: !0, controls: !1 },
  methods: {
    upDate: function (e) {
      var t = wx.createVideoContext("myVideo", this);
      e ? t.requestFullScreen({ direction: 90 }) : t.exitFullScreen();
    },
    onVideoBtnTap: function () {
      var e = this;
      return r(
        t.default.mark(function r() {
          var o;
          return t.default.wrap(function (t) {
            for (;;)
              switch ((t.prev = t.next)) {
                case 0:
                  (o = wx.createVideoContext("myVideo", e)),
                    e.setData({ isShowVideoBtn: !1, controls: !0 }),
                    o.play();
                case 3:
                case "end":
                  return t.stop();
              }
          }, r);
        }),
      )();
    },
    getVideoInfo: function (e) {
      var t = this.format(e.detail.duration);
      this.triggerEvent("videoLength", { time: t });
    },
    screenChange: function () {
      wx.createVideoContext("myVideo", this).exitFullScreen();
    },
    format: function (e) {
      var t = e;
      return (
        t < 0 && (t = 0),
        ""
          .concat(
            "0".repeat(2 - String(Math.floor(t / 60)).length) +
              Math.floor(t / 60),
            ":",
          )
          .concat("0".repeat(2 - String(Math.floor(t % 60)).length))
          .concat(Math.floor(t % 60))
      );
    },
  },
});
